<template>
    <div>
        <van-nav-bar title="父传值" right-text="保存" left-arrow @click-left="onClickLeft"
            @click-right="onClickRight" />
    </div>
</template>

<script>
 import { NavBar } from "vant";
    export default {
    name:"setNav",
    components: {
    VanNavBar: NavBar,
  },
        props: {
      title: {
        type: String,
        default: "",
      },
      leftArrow: {
        type: Boolean,
        default: true,
      },
      rightText:{
        type:String,
        default:''
      }
    },
    methods: {
      onClickLeft() {
       const currentPath =  this.$route.path
       const newPath = currentPath.substring(0 ,currentPath.lastIndexOf('/'))
       this.$router.push(newPath)
      },
      onClickRight() {
        console.log("保存修改后的数据")
      }
    }
    }
</script>

<style lang="scss" scoped>

</style>